<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https:cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<button onclick="test()">点我</button>
<script>
    function test() {
        $.ajax({
            url: 'http://localhost:8000/home/home/',
            type: 'post',
            contentType: 'application/json',
            data: JSON.stringify({'name': 'AK'}),
            success: function(data) {
                alert(data);
                console.log(data);
            }
        })
    }
</script>
</body>
</html>